package com.shuany.ws.cxf.demo;

import org.apache.cxf.endpoint.Server;
import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
import org.apache.cxf.jaxws.JaxWsServerFactoryBean;

public class WebServiceServer {

    public static void main(String[] args) {
        JaxWsServerFactoryBean  factory = new JaxWsServerFactoryBean();
        factory.setAddress("http://localhost:8080/HelloWorld");
        factory.setServiceClass(HelloWorldImpl.class);
        factory.getInInterceptors().add(new LoggingInInterceptor());
        factory.getOutInterceptors().add(new LoggingOutInterceptor());
        Server server = factory.create();
        server.start();
    }
}
